<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,initial-scale=1">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" href="http://n3.sinaimg.cn/games/zqcpk/base.css">
	<style type="text/css">
		nav ul i.photo {
		  height: 30px;
		  width: 30px;
		  background-color: #fff;
		  border-radius: 50%;
		  line-height: 0;
		  margin-top: -4px;
		}
		header .logo i.icon {
			  display: inline-block;
			  height: 39px;
			  width: 166px;
			  background-position: 0 0;
			  vertical-align: middle;
			  background: url("http://n.sinaimg.cn/games/zqcpk/icon.png") no-repeat;
			  background-size: 162px 77px;
		}
		.d-titile em{
			display: inline-block;
  			min-width: 60px;
		}
		
	</style>
</head>
<body>
<header>
    <nav class="content">
        <div class="clear" id="headtop">
            <div class="logo"><i class="icon"></i></div>
            <ul>
                <li class="login">
											<a href="https://passport.sina.cn/signin/signin?vt=4&amp;cid=110947&amp;entry=wapsso&amp;r=http%3A%2F%2Fgames.sina.cn%2Finterface%2Fzq_cpk.d.html&amp;revalid=1" class="login" ><i class="icon"></i></a>
										
                    
                </li>
            </ul>
        </div>
    </nav>
</header>
<nav class="topnav">
    <div class="nav firstnav clear">
        <a href="javascript:;" title="推荐" class="options current">推荐<span></span></a>
        <a href="javascript:;" title="热门" class="options">热门<span></span></a>
        <a href="javascript:;" title="最新" class="options">最新<span></span></a>
        <a href="javascript:void(0);" title="筛选" class="filterBtn">筛选<i class="down-arrow"></i></a>
    </div>
	
	
	
    <div class="filterBox" style="display: none;">
        <div class="nav secondnav">
            <div class="sup-nav clear">
                <span class="sn-title">游戏类型：</span>
                <div class="type-list">
                    <ul>
						<li class="all on">全部</li><li>角色扮演</li><li>动作</li><li>射击</li><li>竞速</li><li>策略</li><li>音乐舞蹈</li><li>体育</li><li>休闲</li><li>MOBA</li>
                    </ul>
                </div>
            </div>
            <div class="sup-nav">
                <span class="sn-title">游戏画面：</span>
                <div class="type-list">
                    <ul>
                        <li class="all on">全部</li><li>3D画面</li><li>2.5D画面</li><li>2D画面</li>
                    </ul>
                </div>
            </div>
            <div class="sup-nav">
                <span class="sn-title">字母检索：</span>
                <div class="type-list">
                    <ul>
                        <li class="all on">全部</li><li>A</li><li>B</li><li>C</li><li>D</li><li>E</li><li>F</li><li>G</li><li>H</li><li>I</li><li>J</li><li>K</li><li>L</li><li>M</li><li>N</li><li>O</li><li>P</li><li>Q</li><li>R</li><li>S</li><li>T</li><li>U</li><li>V</li><li>W</li><li>X</li><li>Y</li><li>Z</li>
                    </ul>
                </div>
            </div>
            <div class="sup-nav">
                <span class="sn-title">游戏风格：</span>
                <div class="type-list">
                    <ul>
                        <li class="all on">全部</li><li>Q版</li><li>奇幻</li><li>魔幻</li><li>玄幻</li><li>科幻</li><li>武侠</li><li>卡通</li><li>写实</li><li>其他</li>
                    </ul>
                </div>
            </div>
            <div class="sup-nav">
                <span class="sn-title">厂商分类：</span>
                <div class="type-list">
                    <ul>
                        <li class="all on">全部</li><li>网易</li><li>腾讯</li><li>畅游</li><li>盛大</li><li>巨人</li><li>空中网</li><li>完美</li><li>中青宝</li><li>金山</li><li>久游</li><li>麒麟</li><li>网龙</li><li>蓝港</li>
                    </ul>
                </div>
            </div>
            <div class="flexbox opt-btn">
                <button class="resetBtn">重置</button><button class="okBtn active">确认</button>
            </div>
        </div>
    </div>
</nav>
<div class="main">
    <div class="content">
            <div class="search-active">
                <div class="search-content">
                    <form class="search-form" action="http://games.sina.cn/interface/search_zq_cpk.d.html" >
                        <div class="search">
                            <span class="icon search-icon"></span>
                            <div class="search-box">
                                <input type="text" placeholder="请输入网游名称..." onkeydown='if(event.keyCode==13){search_submit();}' autocomplete="off" id="search_keyword" name="search_keyword">
								<input type="hide" name="pt" id="pt" value="">
								<input type="hide" name="gp" id="gp" value="">
								<input type="hide" name="it" id="it" value="">
								<input type="hide" name="gs" id="gs" value="">
								<input type="hide" name="pc" id="pc" value="">
                            </div>
                        </div>
                    </form>
                    <div class="search_think" style="display: none;">
                        <!--联想词汇-->
                    </div>
                </div>
            </div>
        <div class="c-box1">
				<div class="square  xskColor">
		<a href="javascript:;" class="flexbox">
			<dt class="gamePhoto"><img data-url="http://games.sina.cn/zq/wow" src="http://n.sinaimg.cn/games/20160518/FfAx-fxsenvx1073399.jpg"/></dt>
			<div class="detail">
				<h3 class="d-titile ellipsis">魔兽世界&nbsp;&nbsp;
										<em data-url="http://games.sina.cn/cgwr/evaluating/2016-04-22/id-ifxrpvea1111473.d.html">9.6分</em>
									</h3>
				<p class="d-comp ellipsis">运营商：网易游戏</p>
				<p class="d-icon ellipsis">角色扮演<em>|</em>魔幻<em>|</em>3D画面<em>|</em>商业化</p>
			</div>
		</a>
				<a href="http://ka.sina.com.cn/html5/gift_gameinfo/2591" class="receive" target="_blank">领</a>
			</div>
	<div class="square  xskColor">
		<a href="javascript:;" class="flexbox">
			<dt class="gamePhoto"><img data-url="http://games.sina.cn/zq/wuxia" src="http://n.sinaimg.cn/games/20160518/RCmO-fxsexua6271382.jpg"/></dt>
			<div class="detail">
				<h3 class="d-titile ellipsis">天涯明月刀&nbsp;&nbsp;
										<em data-url="http://games.sina.cn/cgwr/evaluating/2015-08-18/id-ifxfxzzn7549381.d.html">9.0分</em>
									</h3>
				<p class="d-comp ellipsis">运营商：腾讯游戏</p>
				<p class="d-icon ellipsis">角色扮演<em>|</em>武侠<em>|</em>3D画面<em>|</em>公测</p>
			</div>
		</a>
				<a href="http://ka.sina.com.cn/html5/gift_gameinfo/6358" class="receive" target="_blank">领</a>
			</div>
	<div class="square  xskColor">
		<a href="javascript:;" class="flexbox">
			<dt class="gamePhoto"><img data-url="http://games.sina.cn/cpk/o/2015-04-09/cpk-ichmifpy6845722.d.html" src="http://n.sinaimg.cn/games/20160518/cS2y-fxsexua6273395.jpg"/></dt>
			<div class="detail">
				<h3 class="d-titile ellipsis">守望先锋&nbsp;&nbsp;
									</h3>
				<p class="d-comp ellipsis">运营商：网易游戏</p>
				<p class="d-icon ellipsis">射击<em>|</em>卡通<em>|</em>3D画面<em>|</em>封测</p>
			</div>
		</a>
				<a href="http://ka.sina.com.cn/html5/gift_gameinfo/8058" class="receive" target="_blank">领</a>
			</div>
	<div class="square  xskColor">
		<a href="javascript:;" class="flexbox">
			<dt class="gamePhoto"><img data-url="http://games.sina.cn/zq/lol" src="http://n.sinaimg.cn/games/20160518/sYDT-fxsexua6276076.jpg"/></dt>
			<div class="detail">
				<h3 class="d-titile ellipsis">英雄联盟&nbsp;&nbsp;
										<em data-url="http://games.sina.cn/cgwr/evaluating/2015-09-02/id-ifxhkafa9597851.d.html">8.8分</em>
									</h3>
				<p class="d-comp ellipsis">运营商：腾讯游戏</p>
				<p class="d-icon ellipsis">MOBA<em>|</em>魔幻<em>|</em>3D画面<em>|</em>商业化</p>
			</div>
		</a>
				<a href="http://ka.sina.com.cn/html5/gift_gameinfo/619" class="receive" target="_blank">领</a>
			</div>
	<div class="square  xskColor">
		<a href="javascript:;" class="flexbox">
			<dt class="gamePhoto"><img data-url="http://games.sina.cn/zq/dota2" src="http://n.sinaimg.cn/games/20160518/xlSL-fxsenvm0582014.jpg"/></dt>
			<div class="detail">
				<h3 class="d-titile ellipsis">DOTA2&nbsp;&nbsp;
										<em data-url="http://games.sina.cn/cgwr/evaluating/2016-05-18/id-ifxsenvm0580868.d.html">8.7分</em>
									</h3>
				<p class="d-comp ellipsis">运营商：完美世界</p>
				<p class="d-icon ellipsis">MOBA<em>|</em>魔幻<em>|</em>3D画面<em>|</em>内测</p>
			</div>
		</a>
				<a href="http://ka.sina.com.cn/html5/gift_gameinfo/6038" class="receive" target="_blank">领</a>
			</div>
	<div class="square  xskColor">
		<a href="javascript:;" class="flexbox">
			<dt class="gamePhoto"><img data-url="http://games.sina.cn/zq/cf" src="http://n.sinaimg.cn/games/20160518/M5QS-fxsenvx1076947.jpg"/></dt>
			<div class="detail">
				<h3 class="d-titile ellipsis">穿越火线&nbsp;&nbsp;
										<em data-url="http://games.sina.cn/cgwr/evaluating/2016-05-19/id-ifxsktkp8971761.d.html">8.3分</em>
									</h3>
				<p class="d-comp ellipsis">运营商：腾讯游戏</p>
				<p class="d-icon ellipsis">射击<em>|</em>科幻<em>|</em>3D画面<em>|</em>商业化</p>
			</div>
		</a>
				<a href="http://ka.sina.com.cn/html5/gift_gameinfo/3831" class="receive" target="_blank">领</a>
			</div>
	<div class="square  xskColor">
		<a href="javascript:;" class="flexbox">
			<dt class="gamePhoto"><img data-url="http://games.sina.cn/zq/hs" src="http://n.sinaimg.cn/games/20160518/QCwn-fxsenvx1076974.jpg"/></dt>
			<div class="detail">
				<h3 class="d-titile ellipsis">炉石传说&nbsp;&nbsp;
										<em data-url="http://games.sina.cn/cgwr/evaluating/2016-05-18/id-ifxsenvn7307521.d.html">8.3分</em>
									</h3>
				<p class="d-comp ellipsis">运营商：网易游戏</p>
				<p class="d-icon ellipsis">策略<em>|</em>魔幻<em>|</em>2D画面<em>|</em>公测</p>
			</div>
		</a>
				<a href="http://ka.sina.com.cn/html5/gift_gameinfo/6689" class="receive" target="_blank">领</a>
			</div>
	<div class="square  xskColor">
		<a href="javascript:;" class="flexbox">
			<dt class="gamePhoto"><img data-url="http://games.sina.cn/zq/dnf" src="http://n.sinaimg.cn/games/20160518/7FTR-fxsenvx1077131.jpg"/></dt>
			<div class="detail">
				<h3 class="d-titile ellipsis">地下城与勇士&nbsp;&nbsp;
										<em data-url="http://games.sina.cn/cgwr/evaluating/2016-05-18/id-ifxsenvn7308258.d.html">8.2分</em>
									</h3>
				<p class="d-comp ellipsis">运营商：腾讯游戏</p>
				<p class="d-icon ellipsis">动作<em>|</em>卡通<em>|</em>2D画面<em>|</em>商业化</p>
			</div>
		</a>
				<a href="http://ka.sina.com.cn/html5/gift_gameinfo/3856" class="receive" target="_blank">领</a>
			</div>
	<div class="square  xskColor">
		<a href="javascript:;" class="flexbox">
			<dt class="gamePhoto"><img data-url="http://games.sina.cn/cpk/o/2012-09-06/cpk-iavxeafs0045666.d.html" src="http://n.sinaimg.cn/games/20160518/mUoo-fxsexua6280619.jpg"/></dt>
			<div class="detail">
				<h3 class="d-titile ellipsis">战舰世界&nbsp;&nbsp;
										<em data-url="http://games.sina.cn/cgwr/evaluating/2016-04-22/id-ifxrpvea1096100.d.html">8.6分</em>
									</h3>
				<p class="d-comp ellipsis">运营商：空中网</p>
				<p class="d-icon ellipsis">射击<em>|</em>写实<em>|</em>3D画面<em>|</em>公测</p>
			</div>
		</a>
				<a href="http://ka.sina.com.cn/html5/gift_gameinfo/6178" class="receive" target="_blank">领</a>
			</div>
	<div class="square  xskColor">
		<a href="javascript:;" class="flexbox">
			<dt class="gamePhoto"><img data-url="http://games.sina.cn/cpk/o/2010-04-21/cpk-icesifvy3967804.d.html" src="http://n.sinaimg.cn/games/20160518/99l8-fxsenvm0583691.jpg"/></dt>
			<div class="detail">
				<h3 class="d-titile ellipsis">暗黑破坏神3&nbsp;&nbsp;
										<em data-url="http://games.sina.cn/cgwr/evaluating/2015-03-26/id-iawzuney1164623.d.html">8.8分</em>
									</h3>
				<p class="d-comp ellipsis">运营商：暴雪</p>
				<p class="d-icon ellipsis">角色扮演<em>|</em>魔幻<em>|</em>3D画面<em>|</em>公测</p>
			</div>
		</a>
				<a href="http://ka.sina.com.cn/html5/gift_gameinfo/8000" class="receive" target="_blank">领</a>
			</div>
       
        </div>
        <div class="c-box1 rm-box">
			<!--最热排行榜-->
            <div class="addMore rmAddList"><i class="moreIcon"></i><span>加载更多</span></div>
        </div>
        <div class="c-box1">
            <!--最新排行榜-->
            <div class="addMore zxAddList"><i class="moreIcon"></i><span>加载更多</span></div>
        </div>
    </div>
</div>
<a href="#" class="gotop"><i></i></a>
<footer>
    <div class="content">
        <div class="ftr">
            <p>新浪游戏产品库</p>
        </div>
    </div>
</footer>
<script src='http://n.sinaimg.cn/games/zqcpk/jquery-1.11.3.min.js'></script>
<script>
	//初始化
	var current_index = 0;
	$(".c-box1").hide();
    $($(".c-box1")[0]).show();
	//点击加载
	$(".zxAddList").on("click",function(){
		zxlist($(this));
	});
	$(".rmAddList").on("click",function(){
		rmlist($('.rmAddList'));
	});
	$(".search-icon").click(function(){
		$(".search-form").submit();
	});
	function search_submit(){
		$(".search-form").submit();
	}
    $(".firstnav .options").on("click",function(){
        $(".firstnav .options").removeClass("current");
        $(this).addClass("current");
        var index = $(this).index();
		current_index = index;
		//if(index == 2) zxlist();
        $(".c-box1").hide();
        $($(".c-box1")[index]).show();
        
    });
    /*---------筛选下拉----------*/
    $(".filterBtn").on("click",function(){
        var filter = $('.topnav .filterBox');
        filter.height($(document).height()-56-45);
        filter.toggle();
        if(filter.css("display") == "block"){
            $(".topnav .down-arrow").addClass("up");
        }else{
            $(".topnav .down-arrow").removeClass("up");
        }
    });
    //重置
    $(".resetBtn").on("click",function(){
        $(".type-list li").removeClass("on");
        $(".type-list .all").addClass("on");
    });
    //确认
    $(".okBtn").on("click", function () {
		
        $('.topnav .filterBox').hide();
        $(".topnav .down-arrow").removeClass("up");
		$("#pt").val( $($(".type-list")[0]).find('.on').text());
		$("#gp").val( $($(".type-list")[1]).find('.on').text());
		$("#it").val( $($(".type-list")[2]).find('.on').text());
		$("#gs").val(  $($(".type-list")[3]).find('.on').text());
		$("#pc").val( $($(".type-list")[4]).find('.on').text());
		$(".search-form").submit();
		
    })
    $(".c-box1").delegate(".d-titile em","click",function(){
        window.open($(this).data('url'),"_blank");
    });
	$(".c-box1").delegate(".gamePhoto img","click",function(){
        window.open($(this).data('url'),"_blank");
    });
 /* ----滑动菜单begin----*/
    var x;
    var totalWidth =0;
    var windowWidth = $(window).width();
    var startCur = 0;
    // 结束个数
    //var endCur = liLen-clen.splice(1,1)+1;
    var endCur = 0;
    function turnlist(obj, c,style){
        var left
        var moveLeft = 0
        var style = style||0;
        for(var i=0; i<c; i++){
            var thisWidth = obj.find('li').eq(i).width();
            moveLeft = moveLeft + (thisWidth+25);
        }
        left = moveLeft
        if(style == 1){
            left = 25;
            obj.stop(true,false).animate({left: left},200, function(){
                $(this).animate({left: 0}, 100);
            });
        }else if(style == 2){
            obj.stop(true,false).animate({left: -left-25},200, function(){
                $(this).animate({left: -left}, 100);
            });
        }else{
            obj.stop(true,false).animate({left: -left}, 200);
        }
    }
    $(".type-list").on({
        'touchstart':function(ev){
            var changetouch = ev.originalEvent.changedTouches[0];
            x = changetouch.clientX;
        },
        'touchmove':function(e){
            e.preventDefault();
        },
        'touchend':function(ev){
            var target = ev.target;
            console.log(target.tagName);
            if(target.tagName == "DIV"){
                target= $(target).find('ul');
            }else if(target.tagName == "LI"){
                target = $(target).parent();
            }else{
              target = $(target);
            };
            makeEndCur(target);
            var changetouch = ev.originalEvent.changedTouches[0];
            if(changetouch.clientX-x<-20){
                if(startCur<endCur){
                    startCur++;
                    turnlist(target,startCur,0);
                }else{
                    startCur=endCur;
                    turnlist(target,startCur,2);
                }
            }else if(changetouch.clientX-x>20){
                if(startCur>0){
                    startCur--;
                    turnlist(target,startCur,0);
                }else{
                    turnlist(target,startCur,1);
                }
            }
        }
    });
    function makeEndCur(obj){
        var cWidth =0;
        var li = obj.find('li');
        var liLen = li.length;
        var clen = new Array();
        var titlistWidth = obj.parent().width()-72;
        for(var i=0; i<liLen; i++){
            var liWidth = li[i].clientWidth;
            cWidth = cWidth + (liWidth+25);
            if(cWidth-titlistWidth>50){
                clen.push(i);
            }
        }
        if(clen.length>0){
            endCur = clen.length;
        }else{
            endCur = 0;
        }
    };
    $(".type-list li").click(function(event) {
        $(this).addClass('on').siblings().removeClass('on');
    });
    /* ----滑动菜单end----*/
    /*-----------搜索框--------------*/
    $("#search_keyword").on("keyup focus",function(e){
        var t=$("#search_keyword").val();
        if(t!=""){
			tink_list();
            $(".search_think").show();
            $("body").bind("click",clickTest);
        }else{
            $(".search_think").hide();
        }
    });
    function clickTest(e){
        var obj=e.target;
        if($(obj).hasClass("search-item") || obj.id == "search_keyword"){
        }else{
            $(".search_think").hide();
            $("body").unbind("click",clickTest);
        }
    }
	var zxpage = 1;
	var zx_can_ajax = true;
	function zxlist(obj){
		
		//find_li_on();
		var spanText = obj.find('span');
		if(spanText.text() == '没有更多了') {
			alert('已经加载了全部');
			return;
		}
		if(!zx_can_ajax) return;
		zx_can_ajax = false;
		//shaix['page'] = zxpage;
		$.ajax({ 
			type:'GET', 
			url: "http://games.sina.cn/interface/get_zq_cpk_interface.d.html", 
			data:{
				page:zxpage,
				//pt: $($(".type-list")[0]).find('.on').text(),
				//gp : $($(".type-list")[1]).find('.on').text(),
				//it : $($(".type-list")[2]).find('.on').text(),
				//gs : $($(".type-list")[3]).find('.on').text(),
				//pc : $($(".type-list")[4]).find('.on').text()				
			},
			dataType:'json',
			success: function(d){ 
				zxpage++;
			/*可在此进行数据处理*/
				//console.log(d);
				//debugger;
				if(d.num>0){
					zx_can_ajax = true;
					//$(".c-box1").hide();
					$($(".c-box1")[2]).find('.addMore').before(d.list);
					
				}
				if(d.num<10){
					spanText.text('没有更多了');
				}
			} 			
		}); 
	}
	var rmpage = 1;
	var rm_can_ajax = true;
	function rmlist(obj){
		var spanText = obj.find('span');
		if(spanText.text() == '没有更多了') {
			alert('已经加载了全部');
			return;
		}
		if(!rm_can_ajax) return;
		rm_can_ajax = false;
		$.ajax({ 
			type:'GET', 
			url: "http://zq.games.sina.com.cn/ol/hot.php", 
			data:{
				page:rmpage,
				//pt: $($(".type-list")[0]).find('.on').text(),
				//gp : $($(".type-list")[1]).find('.on').text(),
				//it : $($(".type-list")[2]).find('.on').text(),
				//gs : $($(".type-list")[3]).find('.on').text(),
				//pc : $($(".type-list")[4]).find('.on').text(),
				callback:'rmcallback'				
			},
			dataType:'jsonp',
			jsonp:'rmcallback',
			success: function(d){ 
				//consloe.log(d);
			} 			
		}); 
	}
	function rmcallback(json){
		rm_can_ajax = true;
		rmpage++;
		/*可在此进行数据处理*/
		//console.log(json);
		//debugger;
		if(json.num>0){			
			$(".rm-box").find('.addMore').before(json.list);			
		}
		if(json.num<10){
			$(".rmAddList").find('span').text('没有更多了');
		}
	}
	rmlist($('.rmAddList'));
	//默认加载
	zxlist($(".zxAddList"));
	function tink_list(){
		$.ajax({ 
			type:'GET', 
			url: "http://games.sina.cn/interface/get_search_zq_cpk_inderface.d.html", 
			data:{
				page:1,
				search_keyword:$("#search_keyword").val(),
				type:2//联想接口
			},
			dataType:'json',
			success: function(d){ 
				console.log(d);
				$(".search_think").html(d.list);
			} 			
		}); 
	
	}
	
	$(window).scroll(function (e) {
        if( $(window).scrollTop()==$('body').height()-$(window).height()){
			if(current_index==2){
            	zxlist($(".zxAddList"));
			}
			if(current_index==1){
            	rmlist($('.rmAddList'));
			}
            
        }
    });
</script>
</body>
</html>
